package org.zfm.org.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.zfm.base.BaseDomain;
import java.util.Date;
import java.util.List;

import lombok.Data;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "部门信息",description = "部门信息")
public class Department extends BaseDomain {
    @ApiModelProperty(value = "部门名字")
    private String name;
    @ApiModelProperty(value = "部门简介")
    private String  intro;
    @ApiModelProperty(value = "父级部门")
    private Department parent;
    @ApiModelProperty(value = "部门主管")
    private Employee manager;
    @ApiModelProperty(value = "创建时间")
    private Date create_time;
    @ApiModelProperty(value = "更新时间")
    private Date update_time;
    @ApiModelProperty(value = "部门path")
    private String path;
    @ApiModelProperty(value = "状态 0：禁用  1：正常")
    private Byte state;
    @ApiModelProperty(value = "子节点")
    private List<Department> children;
    public Department(Long id, String name) {
        super(id);
        this.name = name;
    }

    //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss timezone:GMT+8")
    public Date getCreate_time() {
        return create_time;
    }

//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss timezone:GMT+8")
    public Date getUpdate_time() {
        return update_time;
    }
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }
}
